<?php
/**
 * 
 * @author Jonathan Rotini
 * @abstract
 * @version 1.0
 * @todo complement documentation
 */
abstract class DataObject extends SerialisableObject
{       
        protected $_data = array();
        /**
         * Determine if an object exist or not in dataBase
         * @abstract
         * @static
         * @access public
         * @param Integer|String $id
         * @return boolean
         */
        abstract static public function exist($id);
        /**
         * Insert the object in DataBase
         * @abstract
         * @access protected
         * @return void
         * @throws
         */
        abstract protected function _insert();
        /**
         * Set a new value to the selected attribute after control of integrity of value
         * @abstract
         * @param String $attribute Name of the attribute
         * @param Mixed $value Value of the attribute
         * @access protected
         * @return boolean
         */
        abstract protected function _setAttribute($attribute, $value);
        /**
         * Delete the object in DataBase
         * @abstract
         * @access public
         * @return void
         * @throws
         */
        abstract public function delete();
        /**
         * Update the object in DataBase
         * @abstract
         * @access public
         * @return void
         * @throws
         */
        abstract public function update();
        /**
         * Set a new value to the selected attribute
         * @abstract
         * @access public
         * @param String $attribute Name of the attribute
         * @param Mixed $value Value of the attribute
         * @return boolean
         */
        abstract public function set($attribute, $value = NULL);
        /**
         * Return the value of the selected attribute
         * @abstract
         * @access public
         * @param String $attribute Name of the attribute
         * @return Mixed Value of the selected attribute
         */
        abstract public function __get($attribute);
        /**
         * Create a new entrie in the DataBase after control of integrity of data
         * @abstract
         * @access public
         * @return void
         * @throws
         */
        abstract public function create();
}
?>
